package com.qk.management.controller;

import com.qk.common.Result;
import com.qk.dto.login.LoginDTO;
import com.qk.management.service.UserService;
import com.qk.vo.login.LoginResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:gzc
 * @Date: 2025/10/06 22:19
 * @Description:
 */
@RestController
@RequestMapping("/login")
@Slf4j
public class LoginController {
    @Autowired
    private UserService userService;

    @PostMapping
    public Result login(@RequestBody LoginDTO loginDto) {
        log.info("用户登录：{}", loginDto);
        LoginResultVO loginResult = userService.login(loginDto);
        return Result.success(loginResult);

    }
}
